﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.CMS263.BLL;
using Com.CMS263.PO;
using Com.CMS263.Util;

namespace Com.CMS263.Web.manage.MyStyle
{
    public partial class photoList : System.Web.UI.Page
    {
        public int MyStyleId;
        public Com.CMS263.PO.MyStyle pp;
        public IList<StyleImage> prodlist = new List<StyleImage>();
        StyleImageBLL pibll = new StyleImageBLL();

        public int page = 0;
        public int pagecount = 0;
        public int pagesize = 10;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                MyStyleId = Convert.ToInt32(Request["MyStyleId"]);
                page = Convert.ToInt32(Request["page"]);
                if (page == 0)
                {
                    page = 1;
                }
                prodlist = pibll.GetListByPager(MyStyleId, page, pagesize);
            }
        }
        MyStyleBLL pbll = new MyStyleBLL();
        public Com.CMS263.PO.MyStyle GetProduct(object obj)
        {
            int ProductId = Convert.ToInt32(obj);
            pp = (Com.CMS263.PO.MyStyle)pbll.FindModelById("MyStyle", MyStyleId);
            if (pp == null || pp.Id < 1)
            {
                pp = new Com.CMS263.PO.MyStyle();
            }
            return pp;
        }


        public string GetPager()
        {
            MyStyleId = Convert.ToInt32(Request["MyStyleId"]);
            pagecount = pibll.GetListByPager(MyStyleId);
            return EnPager.GetPager(pagecount, pagesize, page, "&MyStyleId=" + MyStyleId);
        }
    }
}
